package com.wss.lsl.alading.mapper;

import com.wss.lsl.alading.domain.Member;
import com.wss.lsl.alading.domain.Merchandise;
import com.wss.lsl.alading.domain.OrderForm;
import com.wss.lsl.alading.domain.YGDDMX;
import com.wss.lsl.alading.domain.YGDDZB;
import java.math.BigDecimal;
import java.util.Map;

public interface OrderFormMapper extends CommonMapper<OrderForm> {

    OrderForm selectByCouponNo(String couponNo);

    Integer changeStatus(OrderForm orderForm);

    /**
     * Employee exchange cash coupon by it's integrals.
     *
     * @param parameters IN _couponNo VARCHAR(50), IN _employeeMobile
     * VARCHAR(20), IN _quantity INT, IN _terminalId VARCHAR(50), IN
     * _terminalAddress VARCHAR(255), IN _transactionDate VARCHAR(50), OUT
     * returnCode VARCHAR(10)
     */
    public void exchange(Map<String, Object> parameters);

    /**
     * Employee apply consuming coupon
     *
     * @param parameters String couponNo, String terminalId, String
     * merchantName, String merchantAddress, String transactionDate, String
     * transactionNo
     */
    public void applyCoupon(Map<String, Object> parameters);

    /**
     * Expire employee coupons
     *
     * @param parameters String couponNo
     */
    public void expireCoupon(Map<String, Object> parameters);

    public int checkCouponNo(String couponNo);

    public Member selectMemberById(int accountId);

    public Merchandise selectMerchandiseBySPBH();

    public void insertYGDDZB(YGDDZB ygddzb);

    public void insertYGDDMX(YGDDMX ygddmx);

    public void updateMemberBalance(int accountId, BigDecimal sumAmount);

    public void insertOrderForm(String couponNo, BigDecimal marketprice, int quantity, Integer merchandiseId, String transactionDate, int accountId, String mobilePhone, BigDecimal sumAmount, Integer enterpriseId);

    public void insertExchangelog(String terminalId, String merchandiseName, String terminalAddress, String couponNo, String exchange, String returnCode, String errorMessage, String transactionDate, String mobilePhone, String transactionNo);

    /**
     * use couponNo,change orderform state
     *
     * @param state
     * @param transactionNo
     * @param id
     */
    void changeOrderFormState(int state, String transactionNo, int id);

    void updateYGDDZB_state(int state, String couponNo);

    void updateYGDDMX_state(int state, String couponNo);

    /**
     * expire couponNo,change orderform state
     *
     * @param state
     * @param id
     */
    public void changeOrderFormState2(int state, int id);
}
